package com.cs543.j.client.comm;

import cs543.library.rmi.RmiServerInterface;
import cs543.library.rmi.RmiServerRegistry;
import org.json.JSONArray;

public class LocalCloudCommunication extends RmiServerInterface {
@Override
public void register () {
new RmiServerRegistry ().register ("CloudCommunication", this);
}
@Override
public JSONArray call (String method, JSONArray args) {
CloudCommunication obj = new CloudCommunication ();
if (method.equals ("delete")) {
try {
String r0 = args.getString(0);
String ret = obj.delete (r0);
JSONArray arr = new JSONArray ();
arr.put (ret);
return arr;
} catch (Exception e) {}
}
if (method.equals ("copy")) {
try {
String r0 = args.getString(0);
String r1 = args.getString(1);
String r2 = args.getString(2);
String ret = obj.copy (r0, r1, r2);
JSONArray arr = new JSONArray ();
arr.put (ret);
return arr;
} catch (Exception e) {}
}
if (method.equals ("move")) {
try {
String r0 = args.getString(0);
String r1 = args.getString(1);
String ret = obj.move (r0, r1);
JSONArray arr = new JSONArray ();
arr.put (ret);
return arr;
} catch (Exception e) {}
}
if (method.equals ("download")) {
try {
String r0 = args.getString(0);
String r1 = args.getString(1);
String ret = obj.download (r0, r1);
JSONArray arr = new JSONArray ();
arr.put (ret);
return arr;
} catch (Exception e) {}
}
if (method.equals ("upload")) {
try {
String r0 = args.getString(0);
String r1 = args.getString(1);
String ret = obj.upload (r0, r1);
JSONArray arr = new JSONArray ();
arr.put (ret);
return arr;
} catch (Exception e) {}
}
if (method.equals ("lookup")) {
try {
String r0 = args.getString(0);
String ret = obj.lookup (r0);
JSONArray arr = new JSONArray ();
arr.put (ret);
return arr;
} catch (Exception e) {}
}
return null;
}
}